from django.db import models

from utils.basemodel import BaseModel


# Create your models here.

class UserModel(BaseModel):
    username = models.CharField(max_length=20, verbose_name='用户名', unique=True, null=True, blank=True)
    phone = models.CharField(max_length=20, verbose_name='手机号', unique=True, null=True, blank=True)
    email = models.EmailField(verbose_name='邮箱', unique=True, null=True, blank=True)
    password = models.CharField(max_length=20, verbose_name='密码', null=True, blank=True)
    credit = models.IntegerField(default=0, verbose_name='积分')
    head_img = models.ImageField(upload_to='uploads', verbose_name='头像', null=True, blank=True)

    class Meta:
        db_table = 'fguser'

    def __str__(self):
        return self.username
